package com.spic.system.api;

import com.spic.common.core.constant.SecurityConstants;
import com.spic.common.core.constant.ServiceNameConstants;
import com.spic.common.core.domain.R;
import com.spic.system.api.domain.SysJobDto;
import com.spic.system.api.factory.RemoteJobFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 定时任务
 */
@FeignClient(contextId = "remoteJobService", value = ServiceNameConstants.SPIC_JOB , fallbackFactory = RemoteJobFallBackFactory.class)
public interface RemoteJobService {
    /**
     * 创建定时任务
     * @param sysJobDto
     * @return
     */
    @PostMapping("/job/createJob")
    R<String> addSysJob(@RequestBody SysJobDto sysJobDto, @RequestHeader(SecurityConstants.INNER) String source);

    /**
     * 创建定时任务
     * @param jobIds
     * @return
     */
    @DeleteMapping("/job/{jobIds}")
    R<Object> removeSysJob(@PathVariable("jobIds") Long[] jobIds, @RequestHeader(SecurityConstants.INNER) String source);
}
